{if $request_ajax}
<div class="ajax_fancybox">
	<h1 class="title">{_t('add_edit_item')}</h1>
	<form method="post" action="{$BASE_URL}general/degrees" id="frmEdit">
		<table class="form">
			<tr><td width="100">{_t('english_name')}</td><td><input type="text" name="name_en" value="{$arrItem.DEGREE_NAME_EN}" size="40" /></td></tr>
			<tr><td>{_t('vietnamese_name')}</td><td><input type="text" name="name_vi" value="{$arrItem.DEGREE_NAME_VI}" size="40"/></td></tr>
			<tr><td>{_t('priority')}</td><td><input type="text" name="priority" value="{$arrItem.DEGREE_PRIORITY}" size="10"/></td></tr>
			<tr><td>{_t('status')}</td><td>
						{$arr = [1=>_t('publish'), 0=>_t('unpublish')]}
						{html_radios name="publish" options=$arr selected=$arrItem.DEGREE_STATUS|default:1}
				</td></tr>
			<tr><td>&nbsp;</td><td><button type="submit" name="action" value="save"><span>{_t('update_data')}</span></button> <button type="button" onclick="$.fancybox.close()"><span>{_t('cancel')}</span></button></td></tr>
		</table>
		<input type="hidden" name="id" value="{$arrItem.DEGREE_ID}" />
	</form>
</div>
{else}
<div class="box">
	<div class="title">
		<h1>{_t('degree_manager')}</h1>
	</div>
	<div class="content">
	<form name="frmSearch" id="frmSearch" method="post" onsubmit="return checkSubmit()">
		<table class="table-list">
			<thead>
			<tr>
				<th width="10"><input type="checkbox" name="check_all" /></th>
				<th width="30"># ID</th>
				<th>{_t('english_name')}</th>
				<th>{_t('vietnamese_name')}</th>
				<th>{_t('priority')}</th>
				<th>{_t('status')}</th>
				<th>{_t('time_modified')}</th>
				<th>{_t('by')}</th>
			</tr>
			</thead>
			<tbody>
			{foreach from=$arrItems item=item}
			<tr>
				<td><input type="checkbox" name="ids[]" class="multivalue" value="{$item.DEGREE_ID}" /></td>
				<td>{$item.DEGREE_ID}</td>
				<td><a href="{$BASE_URL}general/degrees?id={$item.DEGREE_ID}" class="fancybox fancybox.ajax">{$item.DEGREE_NAME_EN}</a></td>
				<td><a href="{$BASE_URL}general/degrees?id={$item.DEGREE_ID}" class="fancybox fancybox.ajax">{$item.DEGREE_NAME_VI}</a></td>
				<td>{$item.DEGREE_PRIORITY}</td>
				<td>{if $item.DEGREE_STATUS==1}{_t('publish')}{/if}</td>
				<td>{$item.DEGREE_UPDATEDATE|date_format}</td>
				<td>{$item.DEGREE_CREATEUSER}</td>
			</tr>
			{/foreach}
			
		</table>
		<select name="action" id="action">
			<option value="">--- {_t('with_selected')} ---</option>
			<option value="publish">{_t('publish')}</option>
			<option value="unpublish">{_t('unpublish')}</option>
			<option value="delete">{_t('delete')}</option>
		</select>
		<button type="submit"><span>{_t('submit')}</span></button>
		<a href="{$BASE_URL}general/degrees?id=0" class="button fancybox fancybox.ajax">{_t('add_new')}</a>
	</form>
	</div>
</div>
{literal}
<script language="javascript">
function checkSubmit()
{
	if( $('#frmSearch input.multivalue').length < 1)
	{
		alert( LANGUAGE.must_select_items );
		return false;
	}
	var strAction = $('#action').val();
	if( strAction == 'delete')
	{
		if( !confirm( LANGUAGE.confirm_delete_selected_items ) )
			return false;
	}
	return true;
}
</script>
{/literal}
{/if}